import {Sequelize} from 'sequelize-typescript';
import config from '../config'

import {Swiper, Saying, Notice, Curriculum, Announce, Dynamic, Like, User, Admin,Comment,Active,ActiveReg} from "../models";


export const sequelize = new Sequelize({
    database: config.database.dbname,
    port: config.database.port,
    username: config.database.user,
    password: config.database.password,
    dialect: 'mysql',
    timezone: '+08:00',
    models: [Admin, User, Announce, Dynamic, Like, Swiper, Saying, Notice, Curriculum,Comment,Active,ActiveReg],
    repositoryMode: true,
    define: {
        timestamps:true,
        paranoid: true
    },
})

// import {Sequelize} from 'sequelize-typescript';
//
// // import {User} from '../server/User';
// // import {Post} from '../server/Post';
//
// export const index = new Sequelize({
//   database: 'acm',
//   port: 3306,
//   username: 'root',
//   password: 'lyx863996900',
//   dialect: 'mysql',
//   models: [User, Post],
//   repositoryMode: true,
// });
